package com.lxy.mybatis.mapper;

import com.lxy.mybatis.pojo.User.User;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface UserMapper {
    int addUser(@Param("userList") List<User> users);

    List<User> getUserListPage(@Param("userList") List<User> users);

    int updateUser();

    int deleteUser();

    User getUserById();

    List<User> getUserLists();

    //获取多条user的map数据
    List<Map<String, Object>> getUserMap();

    @MapKey("id")
        // id -> String , Object -> new Map();
    Map<Integer, Object> getUserMaps();

    //根据id获取【一条user】的 map对象
    Map<String, Object> getUserMapByName(@Param("name") String name);

    //根据用户名进行用户的模糊查询
    List<Map<String, Object>> getUserMapLikeName(@Param("likeName") String likeName);

    int  deleteMore(@Param("ids") String ids);

    List<User> getUserByTableName(@Param("tabName") String tabName);

//    不指定参数名，mybatis可以自动映射
    int addUserSingle(User users);
}
